$(function(){
	
	var page = 1;
	var tddata=['number','phone','job_no','role','department','use_jurisdiction']
	var addoperation=`<td>
			<div class="tpl-table-black-operation">
				<a class="details" href="javascript:;">
					<i class="am-icon-pencil"></i> 详情
				</a>
				<a class="" href="javascript:;">
					<i class="am-icon-pencil"></i> 编辑
				</a>
				<a href="javascript:;">
					<i class="am-icon-pencil"></i> 删除
				</a>
			</div>
		</td>`
	ajaxlist(1)
	function ajaxlist(page){
	$.ajax({
		type: "post",
		url: "{:url('/admin/beidou/cars')}",
		data: {},
		success: function(res) {
			$("#loading-first").fadeOut(500);
			var pagemain=pagechang(res.data.length, 10, page)
			var tbodymain=tbodymainf(res,page,tddata,addoperation)
			$('.pagination').html(pagemain)
			$('tbody').html(tbodymain)
			$('.laquo').on('click',function(){
				console.log(11)
				ajaxlist(page-1)
			})
			$('.pageli').on('click',function(){
				console.log(11)
				ajaxlist($(this).html())
			})
			$('.raquo').on('click',function(){
				console.log(11)
				ajaxlist(page+1)
			})

		},
		error: function() {
			$("#loading-first").fadeOut(500);
		}
	});
}
	
})
